package com.etone.eos.domain;

import lombok.Data;

import java.io.Serializable;
import java.util.List;

/***
 * 交易记录详情
 */
@Data
public class TransactionDetail implements Serializable {

    /**
     * id : 193d38f63c267931b23bbd564f7ed35dda8627dd0c58f9c1a98323be1a984044
     * trx : {"receipt":{"status":"executed","cpu_usage_us":565,"net_usage_words":15,"trx":[1,{"compression":"none","prunable_data":{"prunable_data":[0,{"signatures":["SIG_K1_Kd9hpjK25pgXCNmdbnZ7r2bzMyvbdHExVbUxBf9gegimSjs7sFcqwcnL4VUKGMmSFLzNKmsmtgphvgqgXQWGpTn7JsRe37"],"packed_context_free_data":""}]},"packed_trx":"aba33262c87a3df93b2200000000010000000000e0fd7b00000000a86cd445010000000000e0fd7b00000000a8ed32321c0000000000e0fd7b650c0244cf60040005727272723205323232323200"}]},"trx":{"expiration":"2022-03-17T02:57:47","ref_block_num":31432,"ref_block_prefix":574355773,"max_net_usage_words":0,"max_cpu_usage_ms":0,"delay_sec":0,"context_free_actions":[],"actions":[{"account":"jjyy","name":"create","authorization":[{"actor":"jjyy","permission":"active"}],"data":{"nm":"jjyy","id":"1232343222324325","file_name":"rrrr2","md5":"22222"},"hex_data":"0000000000e0fd7b650c0244cf600400057272727232053232323232"}],"signatures":["SIG_K1_Kd9hpjK25pgXCNmdbnZ7r2bzMyvbdHExVbUxBf9gegimSjs7sFcqwcnL4VUKGMmSFLzNKmsmtgphvgqgXQWGpTn7JsRe37"],"context_free_data":[]}}
     * block_time : 2022-03-17T02:57:18.000
     * block_num : 96970
     * last_irreversible_block : 96984
     * traces : [{"action_ordinal":1,"creator_action_ordinal":0,"closest_unnotified_ancestor_action_ordinal":0,"receipt":{"receiver":"jjyy","act_digest":"094478ab98475b23af1d0a004a3e189797e20b27051ab2d85a9001134db09cbb","global_sequence":96987,"recv_sequence":14,"auth_sequence":[["jjyy",17]],"code_sequence":1,"abi_sequence":1},"receiver":"jjyy","act":{"account":"jjyy","name":"create","authorization":[{"actor":"jjyy","permission":"active"}],"data":{"nm":"jjyy","id":"1232343222324325","file_name":"rrrr2","md5":"22222"},"hex_data":"0000000000e0fd7b650c0244cf600400057272727232053232323232"},"context_free":false,"elapsed":82,"console":"","trx_id":"193d38f63c267931b23bbd564f7ed35dda8627dd0c58f9c1a98323be1a984044","block_num":96970,"block_time":"2022-03-17T02:57:18.000","producer_block_id":null,"account_ram_deltas":[{"account":"jjyy","delta":140}],"account_disk_deltas":[],"except":null,"error_code":null,"return_value_hex_data":""}]
     */

    private String id;
    private TrxBeanX trx;
    private String block_time;
    private int block_num;
    private int last_irreversible_block;
    private List<TracesBean> traces;

    @Data
    public static class TrxBeanX implements Serializable {
        /**
         * receipt : {"status":"executed","cpu_usage_us":565,"net_usage_words":15,"trx":[1,{"compression":"none","prunable_data":{"prunable_data":[0,{"signatures":["SIG_K1_Kd9hpjK25pgXCNmdbnZ7r2bzMyvbdHExVbUxBf9gegimSjs7sFcqwcnL4VUKGMmSFLzNKmsmtgphvgqgXQWGpTn7JsRe37"],"packed_context_free_data":""}]},"packed_trx":"aba33262c87a3df93b2200000000010000000000e0fd7b00000000a86cd445010000000000e0fd7b00000000a8ed32321c0000000000e0fd7b650c0244cf60040005727272723205323232323200"}]}
         * trx : {"expiration":"2022-03-17T02:57:47","ref_block_num":31432,"ref_block_prefix":574355773,"max_net_usage_words":0,"max_cpu_usage_ms":0,"delay_sec":0,"context_free_actions":[],"actions":[{"account":"jjyy","name":"create","authorization":[{"actor":"jjyy","permission":"active"}],"data":{"nm":"jjyy","id":"1232343222324325","file_name":"rrrr2","md5":"22222"},"hex_data":"0000000000e0fd7b650c0244cf600400057272727232053232323232"}],"signatures":["SIG_K1_Kd9hpjK25pgXCNmdbnZ7r2bzMyvbdHExVbUxBf9gegimSjs7sFcqwcnL4VUKGMmSFLzNKmsmtgphvgqgXQWGpTn7JsRe37"],"context_free_data":[]}
         */

        private ReceiptBean receipt;
        private TrxBean trx;

        @Data
        public static class ReceiptBean implements Serializable {
            /**
             * status : executed
             * cpu_usage_us : 565
             * net_usage_words : 15
             * trx : [1,{"compression":"none","prunable_data":{"prunable_data":[0,{"signatures":["SIG_K1_Kd9hpjK25pgXCNmdbnZ7r2bzMyvbdHExVbUxBf9gegimSjs7sFcqwcnL4VUKGMmSFLzNKmsmtgphvgqgXQWGpTn7JsRe37"],"packed_context_free_data":""}]},"packed_trx":"aba33262c87a3df93b2200000000010000000000e0fd7b00000000a86cd445010000000000e0fd7b00000000a8ed32321c0000000000e0fd7b650c0244cf60040005727272723205323232323200"}]
             */

            private String status;
            private int cpu_usage_us;
            private int net_usage_words;
            private List<Integer> trx;
        }

        @Data
        public static class TrxBean implements Serializable {
            /**
             * expiration : 2022-03-17T02:57:47
             * ref_block_num : 31432
             * ref_block_prefix : 574355773
             * max_net_usage_words : 0
             * max_cpu_usage_ms : 0
             * delay_sec : 0
             * context_free_actions : []
             * actions : [{"account":"jjyy","name":"create","authorization":[{"actor":"jjyy","permission":"active"}],"data":{"nm":"jjyy","id":"1232343222324325","file_name":"rrrr2","md5":"22222"},"hex_data":"0000000000e0fd7b650c0244cf600400057272727232053232323232"}]
             * signatures : ["SIG_K1_Kd9hpjK25pgXCNmdbnZ7r2bzMyvbdHExVbUxBf9gegimSjs7sFcqwcnL4VUKGMmSFLzNKmsmtgphvgqgXQWGpTn7JsRe37"]
             * context_free_data : []
             */

            private String expiration;
            private int ref_block_num;
            private int ref_block_prefix;
            private int max_net_usage_words;
            private int max_cpu_usage_ms;
            private int delay_sec;
            private List<?> context_free_actions;
            private List<ActionsBean> actions;
            private List<String> signatures;
            private List<?> context_free_data;

            @Data
            public static class ActionsBean implements Serializable {
                /**
                 * account : jjyy
                 * name : create
                 * authorization : [{"actor":"jjyy","permission":"active"}]
                 * data : {"nm":"jjyy","id":"1232343222324325","file_name":"rrrr2","md5":"22222"}
                 * hex_data : 0000000000e0fd7b650c0244cf600400057272727232053232323232
                 */

                private String account;
                private String name;
                private DataBean data;
                private String hex_data;
                private List<AuthorizationBean> authorization;

                @Data
                public static class DataBean implements Serializable {
                    /**
                     * nm : jjyy
                     * id : 1232343222324325
                     * file_name : rrrr2
                     * md5 : 22222
                     */

                    private String nm;
                    private String id;
                    private String file_name;
                    private String md5;
                }

                @Data
                public static class AuthorizationBean implements Serializable {
                    /**
                     * actor : jjyy
                     * permission : active
                     */

                    private String actor;
                    private String permission;
                }
            }
        }
    }

    @Data
    public static class TracesBean implements Serializable {
        /**
         * action_ordinal : 1
         * creator_action_ordinal : 0
         * closest_unnotified_ancestor_action_ordinal : 0
         * receipt : {"receiver":"jjyy","act_digest":"094478ab98475b23af1d0a004a3e189797e20b27051ab2d85a9001134db09cbb","global_sequence":96987,"recv_sequence":14,"auth_sequence":[["jjyy",17]],"code_sequence":1,"abi_sequence":1}
         * receiver : jjyy
         * act : {"account":"jjyy","name":"create","authorization":[{"actor":"jjyy","permission":"active"}],"data":{"nm":"jjyy","id":"1232343222324325","file_name":"rrrr2","md5":"22222"},"hex_data":"0000000000e0fd7b650c0244cf600400057272727232053232323232"}
         * context_free : false
         * elapsed : 82
         * console :
         * trx_id : 193d38f63c267931b23bbd564f7ed35dda8627dd0c58f9c1a98323be1a984044
         * block_num : 96970
         * block_time : 2022-03-17T02:57:18.000
         * producer_block_id : null
         * account_ram_deltas : [{"account":"jjyy","delta":140}]
         * account_disk_deltas : []
         * except : null
         * error_code : null
         * return_value_hex_data :
         */

        private int action_ordinal;
        private int creator_action_ordinal;
        private int closest_unnotified_ancestor_action_ordinal;
        private ReceiptBeanX receipt;
        private String receiver;
        private ActBean act;
        private boolean context_free;
        private int elapsed;
        private String console;
        private String trx_id;
        private int block_num;
        private String block_time;
        private Object producer_block_id;
        private Object except;
        private Object error_code;
        private String return_value_hex_data;
        private List<AccountRamDeltasBean> account_ram_deltas;
        private List<?> account_disk_deltas;

        @Data
        public static class ReceiptBeanX implements Serializable {
            /**
             * receiver : jjyy
             * act_digest : 094478ab98475b23af1d0a004a3e189797e20b27051ab2d85a9001134db09cbb
             * global_sequence : 96987
             * recv_sequence : 14
             * auth_sequence : [["jjyy",17]]
             * code_sequence : 1
             * abi_sequence : 1
             */

            private String receiver;
            private String act_digest;
            private int global_sequence;
            private int recv_sequence;
            private int code_sequence;
            private int abi_sequence;
            private List<List<String>> auth_sequence;
        }

        @Data
        public static class ActBean implements Serializable {
            /**
             * account : jjyy
             * name : create
             * authorization : [{"actor":"jjyy","permission":"active"}]
             * data : {"nm":"jjyy","id":"1232343222324325","file_name":"rrrr2","md5":"22222"}
             * hex_data : 0000000000e0fd7b650c0244cf600400057272727232053232323232
             */

            private String account;
            private String name;
            private MD5FileVO data;
            private String hex_data;
            private List<AuthorizationBeanX> authorization;

            @Data
            public static class AuthorizationBeanX implements Serializable {
                /**
                 * actor : jjyy
                 * permission : active
                 */

                private String actor;
                private String permission;
            }
        }

        @Data
        public static class AccountRamDeltasBean implements Serializable {
            /**
             * account : jjyy
             * delta : 140
             */

            private String account;
            private int delta;
        }
    }
}
